<?php
/**
 *
 * Author: lirong
 * Date: 2017/11/19
 * Time: 22:07
 */

define('APP_ROOT',str_replace("\\",'/',__DIR__.'/'));

class Job{

    private  $_beanstalkd =null;

    public function __construct(){
        include APP_ROOT.'Config/conf.php';
        include APP_ROOT.'Beanstalkd/Beanstalkd.php';
        $this->_beanstalkd =new Beanstalkd($config);
    }


    public function start(){

        if (!$this->_beanstalkd->connect()){
            exit("beanstalk is not connnect");
        }
        $this->_beanstalkd->useTube("trj_orders_pay_check");
        $this->_beanstalkd->watch("trj_orders_pay_check");
        $this->_beanstalkd->ignore("default");
       $status =$this->_beanstalkd->statsTube("trj_orders_pay_check");
     //   $status =$this->_beanstalkd->listTubesWatched();
        print_r($status);


        $this->_beanstalkd->disconnect();
    }



}

$jobQuene =new Job();
$jobQuene->start();